/*
 * Copyright (c) 2011 Team A CS2340. All rights reserved.
 */
package edu.gatech.teama.doctorsoffice.model;

import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Immunization.java:  immunization object holds the name of an immunization
 * @author Team A
 * @version 1.0
 *
 */
public class Immunization extends LabWork {
	
	/**
	 *  String of the immunization name
	 */
	private final String immunizationName;
	// TODO: maybe add dosage, qualifications (booster, 2nd round, etc)
	
	/**
	 * Logger for all <code>ClientMessageHandler</code> instances.
	 */
	private static final Logger LOGGER =
		Logger.getLogger("edu.gatech.teama.doctorsoffice.model.Immunization");
	
	static {
		FileHandler fh = null;
		try {
			fh = new FileHandler("application.log");
		} catch (SecurityException e) {
			LOGGER.log(Level.SEVERE,
					"Security Exception creating the logger file handler");
			LOGGER.throwing("ClientMessageHandler", "static", e);
		} catch (IOException e) {
			LOGGER.log(Level.SEVERE, "IO Exception creating the logger file handler");
			LOGGER.throwing("ClientMessageHandler", "static", e);
		}

		LOGGER.addHandler(fh);
		LOGGER.setLevel(Level.ALL);
	}
	
   /**
    * Constructor contains the name of an immunization 
    * @param immunizationName
    */
	public Immunization(String immunizationName) {
		this.immunizationName = immunizationName;
		LOGGER.info("immunization name: " + immunizationName);
	}
	
	/**
	 * Returns the name of the immunization
	 * @return immunizationName
	 */
	@Override
	public String summary() {
		return immunizationName;
	}

}
